﻿@using BlockMain_Class
@{
    Layout = "/Views/Shared/_Layout.cshtml";
}
<link rel="stylesheet" type="text/css" href="/assets/Css/selectcss.css" />

<body>
    <div class="bgimg">
        <div class="left">
            <div class="logo"></div>
        </div>
        <div class="right">
            <div class="top">
                <div class="user">
                    <img class="user-img" src="/Assets/Images/touxiang.png" />
                    <span class="txt">欢迎登录</span>
                </div>
                <div class="checkout">
                    <img class="checkout-img" src="/Assets/Images/fytuichu.png" />
                    <span class="txt" onclick="LoginOut()">退出</span>
                </div>
            </div>
            <div class="middle">
                <div class="contant">
                    <div class="title">
                        送检单位模糊查询
                    </div>
                    <div class="input-part">
                        <div class="input">
                            <label>
                                送检单位：
                                <input type="text" placeholder="请输入有效的送检单位名称" id="hash" />
                            </label>
                        </div>
                        <div class="button" onclick="select()">
                            查询
                        </div>
                    </div>
                    <div class="resualt" style="display: none; float: none;width: 100%">
                        <p>
                            <!--startprint-->
                            <table class="table" border="0" cellspacing="" cellpadding="" style="color: white">
                                <tr><th>送检单位</th><th>添加时间</th><th>Hash</th><th>操作</th></tr>
                                <tbody id="peerstate"></tbody>
                            </table>
                            <!--endprint-->
                        </p>

                    </div>


                </div>
            </div>
        </div>
    </div>
</body>

<script>
    function select() {
        var val = $("#hash").val();
        $.ajax({
            type: "POST",
            url: "/Show/GetList?name=" + val,
            dataType: "json",
            success: function (msg) {
                if (msg != null&&msg.length!=0) {
                    //共识
                    var str1 = "";
                    $.each(msg, function(n, value) {
                        str1 += "<tr><td>" + value.name + "</td><td>" + value.addtime + "</td><td>" + value.hash + "</td><td><a href=\"/Show/Select?hash=" + value.hash + "\">详情</a></td></tr>";
                    });
                    $(".resualt").show();
                    $("#peerstate").html(str1);
                } else {
                    alert("未找到");
                }
            }
        });



    }


</script>

